<?php
/*
# ------------------------------------------------------------------------
# JA Job Board Package
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/

  defined('_JEXEC') or die('Retricted Access');
?>
<script type="text/javascript" language="javascript">
//<![CDATA[
function submitbutton(pressbutton) {
	var form = document.adminForm;

	if (pressbutton == 'cancel') {
		submitform( pressbutton );
		return;
	}
	if ( pressbutton == 'save' || pressbutton == 'apply' ){
		if(form.name.value == '' ){
		    alert('<?php echo JText::_('Category name could not be empty ')?>');
			form.name.focus();
			return;
		}	
		
		submitform( pressbutton );
	}					
	else {
		submitform( pressbutton );
	}
}
//]]>
</script>
<form name="adminForm" action="index.php" method="post">

	<table width="100%">
	<tr>
	
		<td width="80%" valign="top" align="left">
		
		    <div style="width:100%;">
		    <fieldset>
				<legend><?php if($this->item->id) echo JText::_('Edit category'); else echo JText::_('Add category');?></legend>
			    <table>
			    	<TR>
			    		<TD width="80%">
			    	
							<table class="paramlist admintable"  width="100%" cellspacing="1">
					        	<tr>
					        		<td class="paramlist_key" width="32%" align="right">
										<?php echo JText::_( 'ID' ); ?>:
									</td>				
									<td width="68%" class="paramlist_value">
										<strong><?php echo $this->item->id; ?></strong>
									</td>
					        	</tr>	
					        
					        	<tr>
					        		<td class="paramlist_key" align="right">
										<?php echo JText::_( 'Name' ); ?>:
									</td>
									
									<td class="paramlist_value">
										<input class="inputbox" type="text" name="name" size="50" maxlength="255" value="<?php echo $this->item->name;?>" /> 
										<font color="Red">*</font>
									</td>									
					        	</tr>
					        	<tr>
					        		<td class="paramlist_key" align="right">
					        			
										<?php echo JText::_( 'Parent Item' ); ?>:
									</td>
									<td class="paramlist_value">
										<?php  echo $this->tree ; ?>
										<?php //echo  $this->parent_id;?>
									</td>
					        	</tr>
					        	
					        	<tr>
					        		<td class="paramlist_key" align="right">
										<?php echo JText::_( 'Publish' ); ?>:
									</td>
									<td class="paramlist_value">
										<?php echo $this->published; ?>
									</td>
					        	</tr>
					        	<?php if($this->item->params){?>
					        	<tr>
					        		<td colspan="2" align="left">
										<b><?php echo JText::_( 'Parameters' ); ?>:</b>
									</td>								
					        	</tr>
					        	<?php }?>
					        	
					    </table> 
					    <?php if($this->item->params){?>
					    <?php echo $this->item->params->render('params'); ?>
					    <?php }?>
			    	</td>
			    	
			    </TR>
			    </table>
			</fieldset>    
			</div>
		</td>
	</tr>
	</table>
	<input type="hidden" name="id" value="<?php echo $this->item->id; ?>" />
	<input type="hidden" name="cid" value="<?php echo $this->item->id; ?>" />
	<input type="hidden" name="option" value="<?php echo $this->option; ?>" />
	<input type="hidden" name="view" value="jacategories" />
	<input type="hidden" name="task" value="" />
	<?php echo JHTML::_( 'form.token' ); ?>	
 </form>
